package edu.sctu.zhoumengxue.day201506.day20150607.threadPractice;

/**
 * Created by user12 on 2015/6/7.
 */
public class NewThread extends Thread {

    NewThread(){

        super("Demo Thread");
        System.out.println("Child thread:"+this);
        start();
    }

    public void run(){

        try {
            for (int i = 5; i >0 ; i--) {
                System.out.println("Child Thread");
                Thread.sleep(50);
            }
        } catch (InterruptedException e) {
            System.out.println("Exiting child thread.");        }
    }

}
